Skip to content

feat(mcp)!: capture tool arguments and results by default - #219

Merged
aikins01 merged 2 commits into
mainfrom
feat/mcp-capture-payloads-by-default
Nov 10, 2026
Merged

aikins01 merged 2 commits into
mainfrom
feat/mcp-capture-payloads-by-default

Conversation

@aikins01

Copy link
Copy Markdown
Contributor

instrumentMcpTransport() now records tool arguments and tool results on tools/call spans by default. Before this change, a project had to pass capturePayloads: true, so the tools/call spans of most projects had no content, and telemetry.dev could not tell from a span what a tool got or sent back. MCP was the only integration that kept tool content off by default.

A result with isError: true is now recorded too. Its content usually says why the tool failed, which is what a user reads first when a tool breaks. Before, only successful results were recorded, even with capturePayloads: true.

The privacy settings keep their effect:

  • captureInput: false in init() drops the arguments.
  • captureOutput: false drops the result.
  • mask runs on both.
  • capturePayloads: false keeps tool content out while the core SDK records other content.

Error codes and the JSON-RPC error message are recorded with every setting, as before. The package README now says this.

The commit is feat(mcp)! with a BREAKING CHANGE footer, so release-please makes @telemetry-dev/mcp 0.3.0 and a project on ^0.2 does not start to send tool content after a patch update.

After the release, two texts in telemetry.dev still say that MCP payloads are off by default and need the same change: the setup note in apps/web/src/site/pages/features-mcp.ts and the agent prompt in apps/web/src/lib/agent-prompts.ts. The telemetry.dev MCP server sets captureInput: false and captureOutput: false, so its spans stay without customer content after the update.

Tests: vp test run in packages/mcp. The table test covers capturePayloads: false, captureInput: false, and captureOutput: false, and a new test covers a failed result.

tools/call spans now record the tool arguments and the tool result,
including a result with isError: true, whose content says what went
wrong. The core SDK's captureInput, captureOutput, and mask still apply,
and capturePayloads: false keeps tool payloads out.

BREAKING CHANGE: instrumentMcpTransport() without capturePayloads now
records tool arguments and results. Pass capturePayloads: false, or turn
off captureInput and captureOutput, to keep the old behavior.
@aikins01 aikins01 self-assigned this Nov 10, 2026
@aikins01
aikins01 merged commit 9de1520 into main Nov 10, 2026
10 checks passed
@aikins01
aikins01 deleted the feat/mcp-capture-payloads-by-default branch November 10, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant